package com.etc.entity;

import org.springframework.stereotype.Component;

import java.util.Objects;

/**
 * (Favorite)实体类
 *
 * @author makejava
 * @since 2021-10-18 22:32:00
 */
@Component
public class Favorite  {
    private static final long serialVersionUID = -99817634142460161L;
    /**
     * 收藏
     */
    private String favoriteId;
    /**
     * 用户
     */
    private User userId;
    /**
     * 视频
     */
    private Video videoId;
    /**
     * 收藏时间
     */
    private String favoriteDate;


    public String getFavoriteId() {
        return favoriteId;
    }

    public void setFavoriteId(String favoriteId) {
        this.favoriteId = favoriteId;
    }

    public User getUserId() {
        return userId;
    }

    public void setUserId(User userId) {
        this.userId = userId;
    }

    public Video getVideoId() {
        return videoId;
    }

    public void setVideoId(Video videoId) {
        this.videoId = videoId;
    }

    public String getFavoriteDate() {
        return favoriteDate;
    }

    public void setFavoriteDate(String favoriteDate) {
        this.favoriteDate = favoriteDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Favorite favorite = (Favorite) o;
        return Objects.equals(favoriteId, favorite.favoriteId) &&
                Objects.equals(userId, favorite.userId) &&
                Objects.equals(videoId, favorite.videoId) &&
                Objects.equals(favoriteDate, favorite.favoriteDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(favoriteId, userId, videoId, favoriteDate);
    }

    @Override
    public String toString() {
        return "Favorite{" +
                "favoriteId='" + favoriteId + '\'' +
                ", userId=" + userId +
                ", videoId=" + videoId +
                ", favoriteDate='" + favoriteDate + '\'' +
                '}';
    }

    public Favorite() {
    }

    public Favorite(String favoriteId, User userId, Video videoId, String favoriteDate) {
        this.favoriteId = favoriteId;
        this.userId = userId;
        this.videoId = videoId;
        this.favoriteDate = favoriteDate;
    }
}

